<% content_for :page_title do %>
  <%= t('spree.active_sale.title.new') %>
<% end %>

<% content_for :page_actions do %>
  <li>
    <%= button_link_to t('spree.active_sale.link.back'), collection_url, :icon => 'icon-arrow-left', :id => 'back_to_active_sales_link' %>
  </li>
<% end %>

<div data-hook="admin_active_sale_new_form">
  <div id="active-sale-form-wrapper">
    
    <% if @active_sale.try(:errors).present? %>
      <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @active_sale } %>
    <% end %>

    <%= form_for [:admin, @active_sale], :html => { :id => 'admin_active_sale_event' } do |form| %>
      <%= fields_for @active_sale_event do |event_form| %>
        <%= render :partial => 'spree/admin/active_sale_events/form', :locals => { :form => event_form } %>
      <% end %>
    <% end %>
  </div>
</div>
